<?php

namespace App\Providers;

use App\Services\SoapService;
use App\Services\TjSoapService;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
use Laravel\Horizon\Horizon;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        Horizon::auth(function ($request) {
            return false;
        });
        Blade::component('layouts.uploadImg', 'uploadImg');
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        // 使用单例注册 Service 层服务
        $this->app->instance(SoapService::class, new SoapService);
        $this->app->instance(TjSoapService::class, new TjSoapService);
        //$this->app->bind(SoapService::class, function ($app) {
        //    return new SoapService();
        //});
    }
}
